/**
 * 
 */
package jm.demo.auth.domain;

import java.sql.Date;
import java.sql.Timestamp;
import java.util.List;

/**
 * @author Jiming Liu
 *
 */

public class User implements UserInterface {
    
    private Integer id;
    private String name;
    private Date birthday;
    private short status;
    private Timestamp registerDate;
    
    private List<Address> addresses;
    private UserDetail userDetail;
    
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	public short getStatus() {
		return status;
	}
	public void setStatus(short status) {
		this.status = status;
	}
	public Timestamp getRegisterDate() {
		return registerDate;
	}
	public void setRegisterDate(Timestamp registerDate) {
		this.registerDate = registerDate;
	}
	public List<Address> getAddresses() {
		return addresses;
	}
	public void setAddresses(List<Address> addresses) {
		this.addresses = addresses;
	}
	public UserDetail getUserDetail() {
		return userDetail;
	}
	public void setUserDetail(UserDetail userDetail) {
		this.userDetail = userDetail;
	}
    
    
	
	
    
    @Override
	public String toString() {
		return "User [id=" + id + ", name=" + name + ", birthday=" + birthday
				+ ", status=" + status + ", registerDate=" + registerDate
				+ ", addresses=" + addresses + ", userDetail=" + userDetail
				+ "]";
	}
	
    public static User getUserOne() {
    	User result = new User();
    	// 1980-1-1
    	result.setBirthday(new Date(315532800*1000));
    	result.setId(101);
    	result.setName("jiming-1");
    	// 2011-1-1
    	result.setRegisterDate(new Timestamp(1293840000*1000));
    	result.setStatus((short)1);
    	result.setUserDetail(UserDetail.getUserDetailFirst());
    	
    	return result;
    }

    public static User getUserSecond() {
    	User result = new User();
    	// 1981-1-1
    	result.setBirthday(new Date(347155200*1000));
    	result.setId(101);
    	result.setName("jiming-2");
    	// Wed Mar 16 16:56:31 2011
    	result.setRegisterDate(new Timestamp(1300265773*1000));
    	result.setStatus((short)2);
    	result.setUserDetail(UserDetail.getUserDetailSecond());
    	
    	return result;
    }

}
